package com.dries.chat.controller;

import com.dries.chat.entity.Room;
import com.dries.chat.service.IRoomService;
import com.dries.common.api.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 聊天室
 *
 * @author dries
 * @email samphsanie@gmail.com
 * @date 2020-07-24 10:13:58
 */
@RestController
@Api(tags = "聊天室API", value = "RoomController")
@RequestMapping("/chat/room")
public class RoomController {

    @Resource
    private IRoomService roomService;

    /**
     * 列表
     */
    @ApiOperation(value = "聊天室列表")
    @GetMapping("/list")
    public CommonResult list(){

        List<Room> list = roomService.list();

        return CommonResult.success(list);

    }

}
